#ifndef COMPONENTMANAGERDIALOG_H
#define COMPONENTMANAGERDIALOG_H

#include <QDialog>
#include <QSqlDatabase>
#include <QTreeWidgetItem>

namespace Ui {
class ComponentManagerDialog;
}

class ComponentManagerDialog : public QDialog
{
    Q_OBJECT

public:
    explicit ComponentManagerDialog(QWidget *parent = 0, QSqlDatabase db=QSqlDatabase());
    ~ComponentManagerDialog();

    private slots:
        void on_addPushButton_clicked();
        void on_removePushButton_clicked();
        void on_upPushButton_clicked();
        void on_downPushButton_clicked();
        void on_treeWidget_itemChanged(QTreeWidgetItem *item, int column);

private:
    void createComponentItems(QTreeWidgetItem* pitem, int selectCompid);

    Ui::ComponentManagerDialog *ui;
    QSqlDatabase db_;
    bool creatingTree;
};

#endif // COMPONENTMANAGERDIALOG_H
